package cn.tedu.egmvc2.demos.web.controller;

import cn.tedu.egmvc2.pojo.UserDto;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.SQLOutput;

@Controller
public class EmpController {
    @RequestMapping("/emp/add")
    @ResponseBody
    public String add(String name, Double salary,String job){
        System.out.println(name+":"+salary+":"+job);
        return "添加员工成功";
    }
    @RequestMapping("/emp/list")
    @ResponseBody
    public String select(){
        return "查询成功";
    }
    @RequestMapping("/emp/update")
    @ResponseBody
    public String update(UserDto userDto){
        String id = userDto.getId();
        String name = userDto.getName();
        Double salary = userDto.getSalary();
        String job = userDto.getJob();
        System.out.println(id+":"+name+":"+salary+":"+job);
        return "修改成功";
    }
    @RequestMapping("/emp/delete")
    @ResponseBody
    public String delete(String id){
        System.out.println(id);
        return "删除成功";
    }
}
